<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
 * Created by JetBrains PhpStorm.
 * User: b4by
 * Date: 1/23/13
 * Time: 10:18 AM
 * To change this template use File | Settings | File Templates.
 */
class ViewProduct extends MY_Controller
{
    function __construct()
    {
        parent::__construct();
		$this->load->model('model_product');
    }
	
	public function index($product_id)
	{
		$product = $this->model_product->get_info($product_id);
		if($product===FALSE)
		{
			show_error(lang('product_not_exist'));
		}
		$this->data['title'] = $product->info[$this->user_lang->id]->name;
		$this->data['product'] = $product;
		$this->data['temp'] = 'product/index';
		$this->load_view();
	}
}